<template>
  <section>
    <div class="model retrieval">
      <img :src="IMGBASE64.JIANSUOGUANLI2X" class="orange">
      <span class="title">检索管理</span>
      <div class="body">
        <span>物品类别:</span>
        <select class="longSelect" v-model="dutiesSelect" :style="{background: `url(${IMGBASE64.SELECT}) no-repeat scroll right center`}">
          <option v-for="(item, key) in dutiesOption" :label="item.POSITION" :value="key"></option>
        </select>
        <span>物品名称:</span>
        <select class="select" v-model="gradeSelect" :style="{background: `url(${IMGBASE64.SELECT}) no-repeat scroll right center`}" style="margin-right: 4%;">
          <option v-for="(item, key) in gradeOption" :label="item" :value="key"></option>
        </select>
        <el-button type="primary" size="small">搜索</el-button>
        <div class="right">
          <el-button type="success" @click="newAdd" size="small">新增</el-button>
        </div>
      </div>
      <div class="bottom">
        <el-button type="primary" size="small">下载模板</el-button>
        <el-button type="primary" size="small">导出</el-button>
        <el-button type="primary" size="small">导入</el-button>
      </div>
    </div>
    <div class="model management">
      <img :src="INDEXIMGBASE64.RUKUGUANLI2X" class="pink">
      <span class="title">入库管理</span>
      <div class="kong"></div>
      <template>
        <el-table :data="tablemsg" style="width: 100%">
          <el-table-column prop="id" min-width="40" label="#" align="left"></el-table-column>
          <el-table-column prop="name" label="物品类别" min-width="100" align="center"></el-table-column>
          <el-table-column prop="idNo" label="物品名称" min-width="100" align="center" :show-overflow-tooltip='true'></el-table-column>
          <el-table-column prop="mobile" label="品牌型号" min-width="140" align="center" :show-overflow-tooltip='true'></el-table-column>
          <el-table-column prop="gradeWord" label="数量" min-width="80" align="center"></el-table-column>
          <el-table-column prop="subject" label="单价" min-width="100" align="center"></el-table-column>
          <el-table-column prop="postionText" label="总金额" width="100" align="center" :show-overflow-tooltip='true'></el-table-column>
          <el-table-column prop="openid" label="入库日期" align="center" :show-overflow-tooltip='true'></el-table-column>
        </el-table>
        <el-pagination
          v-show="paging"
          @current-change="handleCurrentChange"
          :page-size="20"
          layout="prev, pager, next, jumper"
          :total="total"
          class="pull-right">
        </el-pagination>
      </template>
    </div>

    <div class="newUp" v-show="newShow">
      <img :src="IMGBASE64.GREENXINZENG2X" class="pink">
      <span class="title">新增入库</span>
      <el-button icon="close" class="close" @click="newAdd()"></el-button>
      <div class="kong"></div>
      <el-form label-width="100px">
        <el-col :span="24">
          <el-form-item label="物品类别">
            <el-select v-model="typeSelect">
              <el-option v-for="item in typeOption" :label="item" :value="item"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="物品名称">
            <input type="text" class="text" v-model="name">
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="品牌型号">
            <el-select v-model="resSelect">
              <el-option v-for="item in resOption" :label="item" :value="item"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="数量">
            <input type="text" class="text" v-model="num">
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="单价">
            <input type="text" class="text" v-model="danjia">
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="备注">
            <el-input
              type="textarea"
              :rows="2"
              placeholder="请输入内容"
              v-model="textarea">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="存放地点">
            <input type="text" class="text" v-model="piace">
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="购买日期">
            <el-date-picker
              format="yyyy-MM-dd"
              ref="date"
              v-model="time"
              type="date"
              placeholder="选择日期"
              size="small">
            </el-date-picker>
          </el-form-item>
        </el-col>
      </el-form>
      <el-col :span="24">
        <div class="bottom">
          <div class="left">
            <el-checkbox v-model="checked">继续新建</el-checkbox>
          </div>
          <div class="right">
            <el-button type="success">确定</el-button>
            <el-button @click="newAdd">取消</el-button>
          </div>
        </div>
      </el-col>
    </div>

    <transition name="modal-shadow">
      <div class="modal-backdrop" v-show="isSuccess"></div>
    </transition>
  </section>
</template>

<script>
export default {
  data () {
    return {
      checked: false,
      tablemsg: [],
      paging: false,
      total: 0,
      page: 1,
      dutiesSelect: null,
      dutiesOption: [],
      gradeSelect: null,
      gradeOption: [],
      newShow: false,
      isSuccess: false,
      name: null,
      typeSelect: null,
      typeOption: [],
      resSelect: null,
      resOption: [],
      num: null,
      danjia: null,
      textarea: null
    }
  },
  mounted () {
  },
  methods: {
    handleCurrentChange () {},
    newAdd () {
      this.newShow = !this.newShow
      this.isSuccess = !this.isSuccess
    }
  }
}
</script>

<style scoped>
  .form2 ul{
    overflow: hidden;
  }
  .form2 ul li{
    float: left;
    width: 14%;
    margin-left: 5%;
  }
</style>
<style lang="less" scoped>
@import '/static/css/all-use.css';
@import '/static/css/material-dashboard.css';
  .retrieval{
    .body{
      span{
        margin-left: 5%;
      }
      span:first-child{
        margin-left: 0;
      }
      .longSelect{
        width: 13%;
        border: 0;
        border-bottom: 1px solid #D7D7D7;
        appearance:none;
        -moz-appearance:none;
        -webkit-appearance:none;
        padding-left: 5px;
        padding-right: 18px;
      }
      .select{
        width: 13%;
        border: 0;
        border-bottom: 1px solid #D7D7D7;
        appearance:none;
        -moz-appearance:none;
        -webkit-appearance:none;
        padding-left: 5px;
        padding-right: 18px;
      }
      .right{
        width: 30%;
        float: right;
        text-align: right;
        margin-right: 10px;
        &-text{
          width: 58%;
          border: 0;
          border-bottom: 1px solid #D7D7D7;
        }
        .search{
          background: #00A0E8;
          border: 0;
          border-radius: 2px;
          color: #fff;
          padding: 5px 15px;
        }
      }
    }
    .bottom{
      .right{
        float: right;
        margin-right: 10px;
      }
      &-text{
        padding: 10px 10px;
        border: 0;
        border-bottom: 1px solid #D7D7D7;
      }
    }
  }
  
  .upload-demo{
    display: inline-block;
  }
  .close{
    position: absolute;
    right: 2%;
  }
  .up{
    width: 10%;
    position: absolute;
    top: 0;
    left: 0;
    padding: 20px 20px 0 20px;
    z-index: 99999;
    .green{
      width: 64px;
      height: 64px;
      position: absolute;
      left: 3%;
      top: -20px;
      background: #0DBF9B;
      border-radius: 4px;
      text-align: center;
      line-height: 80px;
    }
    .title{
      margin-left: 96px;
    }
    .header{
      height: 24px;
      border-bottom: 2px solid #D7D7D7;
      padding: 30px 0 10px 0;
      margin-left: 3%;
      margin-bottom: 10px;
      .title{
        height: 24px;
        display: inline-block;
        color: #FB7862;
        border-bottom: 2px solid #FB7862;
        padding: 0 0 10px 0;
        margin-left: 0;
      }
    }
    .select{
      border: 0;
      border-bottom: 1px solid #D7D7D7;
      appearance:none;
      -moz-appearance:none;
      -webkit-appearance:none;
      padding-left: 5px;
      padding-right: 18px;
    }
    .bottom{
      border-top: 1px solid #D7D7D7;
      margin-top: 20px;
      background: #F8F8F8;
      padding: 8px 0;
      margin-left: -20px;
      margin-right: -20px;
      border-radius: 0 0 5px 5px;
      .left{
        width: 50%;
        display: inline-block;
        margin-left: 2%;
      }
      .right{
        width: 43%;
        display: inline-block;
        text-align: right;
      }
    }
  }
  .error{
    color: #FF4949;
  }

  .upload{
    width: 20%;
    position: fixed;
    left: 50%;
    top: 200px;
    margin-left: -10%;
    background: #FFF;
    border-radius: 5px;
    z-index: 99999;
    padding: 10px 10px 10px 10px;
    text-align: center;
    .uploadButton{
      margin-top: 40px;
    }
  }
  .newUp{
    width: 60%;
    position: absolute;
    left: 50%;
    top: 20px;
    margin-left: -30%;
    background: #FFF;
    border-radius: 5px;
    z-index: 99999;
    padding: 20px 10px 0 10px;
    .pink{
      position: absolute;
      left: 2%;
      top: -20px;
    }
    .title{
      margin-left: 96px;
    }
    .text{
      width: 217px;
      border: 0;
      border-bottom: 1px solid #d7d7d7;
    }
    .bottom{
      border-top: 1px solid #D7D7D7;
      margin-top: 20px;
      background: #F8F8F8;
      padding: 8px 0;
      margin-left: -10px;
      margin-right: -10px;
      border-radius: 0 0 5px 5px;
      .left{
        width: 50%;
        display: inline-block;
        margin-left: 2%;
      }
      .right{
        width: 43%;
        display: inline-block;
        text-align: right;
      }
    }
  }
  .details{
  width: 55%;
  position: fixed;
  left: 25%;
  top: 60px;
  background: #FFF;
  border-radius: 5px;
  z-index: 99999;
  padding: 20px 10px 10px 10px;
    .button{
      text-align: center;
    }
    .text{
      border: 0;
      border-bottom: 1px solid #d7d7d7;
    }
  }
</style>
